<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta http-equiv="content-type" content="charset=utf-8;text/html">
    <script src="jquery-1.8.3.min.js" type="text/javascript"></script>
    <script>
        function check(obj) {
            var tValue = document.getElementById("tValue");
            tValue.select();
            tValue.focus();
            alert('message');
            return false;
        }
        $(function () {
            var a="5";
            alert(a===5);
        });
        $(function () {
            //$("#testDiv").empty();
            //$("#testDiv").html("<span>test test</span>");

            try{
               // alert(lastElementPlusTen([]));
                var div=$("div[id='testDiv'][style*='block']");
                alert(div.size());
            }
            catch (error){
                alert("Something went wrong:"+error);
            }
        });

        function lastElement(array) {
            if (array.length > 0) {
                return array[array.length - 1];
            }
            else {
                throw "Cannot take the last element of an empty array.";
            }
        }

        function lastElementPlusTen(array) {
            return lastElement(array) * 10;
        }

    </script>
</head>
<body>
<input type="text" name="cbAll" onchange="check()" id="tValue"/>
<br/>
<input type="button" name="tValue2" id="tValue2" onclick="SelectDiv()"/>
<ul>
    <li>
        <a href="" target="_blank">test1</a>
    </li>
    <li>
        <a href="" target="_blank">test2</a>
    </li>
    <li>
        <a href="" target="_blank">test3</a>
    </li>
</ul>
<div id="testDiv" style="border:1px solid red;display:block;">
    <a href="http://www.baidu.com" target="_blank" id="aLink">测试链接</a> Test Drive
</div>
<div>
    <span title="Title Test">Title Test</span>
</div>
</body>
</html>